#ifndef OPTIMIZED_TRIE_HH_
# define OPTIMIZED_TRIE_HH_

///
/// \file optimized_trie.hh
/// \brief Class that represents an space optimized version of the trie structure.
/// \author Coddy Levi, Sylvain Lobry
/// \version 1.0
///
///
///

#include <iostream>

///
/// \class OptimizedTrie
/// \brief Optimized Trie representation and operations.
///
class OptimizedTrie
{
public:
 
  ///
  /// \brief Returns a pointer to the ith son of the trie node
  /// \param[in]	i Ith son
  /// \return		Pointer to the ith son of the trie node
  ///
  const OptimizedTrie* ith_son(unsigned i) const;

  ///
  /// \brief Accessor to the node's number of sons
  /// \return	the node's number of sons
  ///
  char get_nb_sons() const;

  ///
  /// \brief Basic command line Trie printer 
  ///
  void print (unsigned offset = 0) const;

  ///
  /// The frequency of the word defined by all the letter of the nodes on the branch until this one. 0 if it is not a word present in the dictionary
  ///
  unsigned		frequency;

  ///
  /// Number of nodes in the array representing the Trie to jump to get to the first son of the current node
  ///
  unsigned		first_son_delta;

  ///
  /// The Trie node's letter
  ///
  char			value;

  ///
  /// The Trie node's number of sons
  ///
  char			nb_sons;
};

#endif /* !OPTIMIZED_TRIE_HH_ */
